package ch7;

import java.util.Scanner;

public class Zxf5 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入高度：");
        int a = in.nextInt();
        int c=0;
        for (int b = 1; b <= a; b++) {
            for (c = a; c >= b; c--) {
                System.out.print(" ");
            }
            for (int e = 1;( e <= 2 * b -1); e++) {
                 if (e==2*b-1||e==1||b==a){
                System.out.print("*");
            }else {
                     System.out.print(" ");
               }
            }
            System.out.println("");
        }
    }
}
